﻿package mortal.game.view.mainUI.zazen
{
    import com.mui.controls.*;
    import com.mui.display.*;
    import flash.display.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.player.info.*;
    import mortal.game.view.common.*;

    public class ZazenPlayerRender extends GCellRenderer
    {
        private var _txtName:GTextFiled;
        private var _txtLv:GTextFiled;
        private var _txtCareer:GTextFiled;
        private var _line:ScaleBitmap;
        private var _info:EntityInfo;

        public function ZazenPlayerRender()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._txtName = UIFactory.gTextField("", 33, 5, 200, 20, this);
            this._txtLv = UIFactory.gTextField("", 137, 5, 200, 20, this);
            this._txtCareer = UIFactory.gTextField("", 178, 5, 200, 20, this);
            this._line = UIFactory.bg(0, 29, 282, 2, this, ImagesConst.SplitLine);
            return;
        }// end function

        override protected function initSkin() : void
        {
            var _loc_1:* = new Bitmap();
            this.setStyle("downSkin", ResourceConst.getScaleBitmap(ImagesConst.RegionTitleBg));
            this.setStyle("overSkin", ResourceConst.getScaleBitmap(ImagesConst.RegionTitleBg));
            this.setStyle("upSkin", _loc_1);
            this.setStyle("selectedDownSkin", ResourceConst.getScaleBitmap(ImagesConst.RegionTitleBg));
            this.setStyle("selectedOverSkin", ResourceConst.getScaleBitmap(ImagesConst.RegionTitleBg));
            this.setStyle("selectedUpSkin", ResourceConst.getScaleBitmap(ImagesConst.RegionTitleBg));
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            this._info = param1 as EntityInfo;
            this._txtName.text = this._info.entityInfo.name;
            this._txtLv.text = this._info.entityInfo.level.toString();
            this._txtCareer.text = GameDefConfig.instance.getCarrer(this._info.entityInfo.career);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._txtName.dispose(param1);
            this._txtName = null;
            this._txtLv.dispose(param1);
            this._txtLv = null;
            this._txtCareer.dispose(param1);
            this._txtCareer = null;
            this._line.dispose(param1);
            this._line = null;
            return;
        }// end function

    }
}
